#FROM findepi/graalvm:java17-native
FROM openjdk:17.0.2-oraclelinux8

MAINTAINER Lion Li

RUN mkdir -p /ruoyi/resource/logs \
    /ruoyi/resource/temp \
    /ruoyi/skywalking/agent

WORKDIR /ruoyi/resource

ENV SERVER_PORT=9204 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""

VOLUME /docker/ruoyi/resource:/ruoyi/resource

EXPOSE ${SERVER_PORT}

ADD ./target/ruoyi-resource.jar ./

ENTRYPOINT java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9034 \
            -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
           #-Dskywalking.agent.service_name=ruoyi-resource \
           #-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
           -jar ruoyi-resource.jar \
           -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

